//
//  SelfZiseTool.m
//  10-CellSelf-Size-自适应高度
//
//  Created by 王道林 on 16/7/27.
//  Copyright © 2016年 王道林. All rights reserved.
//

#import "SelfZiseTool.h"

@implementation SelfZiseTool

+ (CGFloat)selfSizeWithString:(NSString *)string height:(CGFloat)height font:(UIFont *)font
{
    CGRect rect = [string boundingRectWithSize:CGSizeMake(0, height) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName: font} context:nil];
    
    return rect.size.width;
}
@end
